<template>
	<view class="pageStyle">
		<!-- <g-watermark/> -->
		<web-view :src="urls"></web-view>
	</view>
</template>
<script>
	import { postFormAction } from "@/utils/request.js";
	import {
		Api
	} from "@/utils/Api.js";
	import {
		mapState
	} from "vuex";
	import {
		getDeptCode
	} from "@/utils/commonHeader.js";

	export default {
		data() {
			return {
				describe: "圈阅",
				url: {
					list: "/static/annotations/index.html#/annotations?skey=",
				},
				urls: "",
			};
		},
		onLoad(options) {
			let records = JSON.parse(options.record);
			console.log('options.record', options.record);
			let path = '';
			let params = {
				skey: this.loginInfo.skey,
				id: records.id
			}
			postFormAction('/flow/getAttachment', params).then(res => {
				console.log('res', res);
				if (res.code == 200) {
					let data = res.data;
					path = data.visualPath + '/' + data.diskName;
					
					this.urls = Api.baseUrl + this.url.list + this.loginInfo.skey + '&id=' + data.id + '&path=' + path + '&isUniWebview=true';
					// this.urls = 'http://localhost:9090/annotations?id=1';
					console.log('urls', this.urls);
				} else {
					uni.showToast({
						icon: 'none',
						mask: false,
						title: res.msg
					});
				}
			});
		},
		computed: {
			...mapState(["loginInfo"]),

			// urls() {
			//   let urls = Api.baseUrl + this.url.list + this.loginInfo.skey + '&isUniWebview=true';
			//   return urls;
			// },
		},
	};
</script>

<style lang="scss" scoped>
</style>
